package com.bookshop.mapper;

import com.bookshop.entity.Book;
import com.bookshop.entity.Cart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Repository
@Mapper
public interface CartMapper {

    int addToCart( @Param("user_id") int user_id , @Param("book_id") int book_id , @Param("book_nums") int book_nums);

    Integer searchCart(@Param("user_id") int user_id , @Param("book_id") int book_id);

    int updateNums(@Param("user_id") int user_id , @Param("book_id") int book_id , @Param("book_nums") int book_nums);

    int deleteFromCart(@Param("userId") int userId , @Param("bookId") int bookId);

    List<Book> selectAllCart(@Param("userId") int userId);

    int addToFavorite(@Param("userId") int userId , @Param("bookId") int bookId);

}
